package com.lighting.lightingservice.service;

import com.lighting.lightingservice.dto.Page;
import com.lighting.lightingservice.dto.Video;
import com.lighting.lightingservice.mapper.VideoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class VideoService {
    @Autowired
    VideoMapper videoMapper;

    public List<Video> getVideoByDB(){
        List<Video> all = videoMapper.findAll();

        for (Video video : all) {
            System.out.println(video.getName());
            return all;
        }
        return null;
    }

    public void setMainVideo(String mainVideo){

        videoMapper.updateMainVideo(mainVideo);
    }

    public void setBlockVideo1(String blockVideo1){

        videoMapper.updateBlockVideo1(blockVideo1);
    }

    public void setBlockVideo2(String blockVideo2){

        videoMapper.updateBlockVideo2(blockVideo2);
    }

    public void setBlockVideo3(String blockVideo3){

        videoMapper.updateBlockVideo3(blockVideo3);
    }

    public void setBlockVideo4(String blockVideo4){

        videoMapper.updateBlockVideo4(blockVideo4);
    }




//***************************测试区**********************************************

    public void insertVideo(String name, String url){
        videoMapper.insertVideo(name, url);
    }

    public void deleteVideo(String name){
        videoMapper.deleteVideo(name);
    }
}
